<?php
/**
 *
 * @author     Daniel Botelho <botelho.daniel@gmail.com>
 */
class oSFilter extends sfFilter
{
  public function execute($filterChain){
    
    $filterChain->execute();
    $response = $this->getContext()->getResponse();

    // arranjar o javascript
    $response->setContent(str_ireplace('//<![CDATA[','',$response->getContent()));
    $response->setContent(str_ireplace('//]]>','',$response->getContent()));

    
    //adicionar os ModulePrefs
    $modulePrefs = OSConfig::include_modules();
    $modulePrefs .= OSConfig::include_userprefs();
    $response->setContent(str_ireplace('<Module>',"<Module>\n".$modulePrefs,$response->getContent()."\n"));

  }
}
